package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiMplstpMapper;
import com.ruoyi.net.domain.ElementBusiMplstp;
import com.ruoyi.net.service.IElementBusiMplstpService;

/**
 * 网元-业务-mplstpService业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiMplstpServiceImpl implements IElementBusiMplstpService 
{
    @Autowired
    private ElementBusiMplstpMapper elementBusiMplstpMapper;

    /**
     * 查询网元-业务-mplstp
     * 
     * @param id 网元-业务-mplstp主键
     * @return 网元-业务-mplstp
     */
    @Override
    public ElementBusiMplstp selectElementBusiMplstpById(String id)
    {
        return elementBusiMplstpMapper.selectElementBusiMplstpById(id);
    }

    /**
     * 查询网元-业务-mplstp列表
     * 
     * @param elementBusiMplstp 网元-业务-mplstp
     * @return 网元-业务-mplstp
     */
    @Override
    public List<ElementBusiMplstp> selectElementBusiMplstpList(ElementBusiMplstp elementBusiMplstp)
    {
        return elementBusiMplstpMapper.selectElementBusiMplstpList(elementBusiMplstp);
    }

    /**
     * 新增网元-业务-mplstp
     * 
     * @param elementBusiMplstp 网元-业务-mplstp
     * @return 结果
     */
    @Override
    public int insertElementBusiMplstp(ElementBusiMplstp elementBusiMplstp)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMplstp.getId())) {
            elementBusiMplstp.setId(uuid);
        }
        elementBusiMplstp.setCreateBy(SecurityUtils.getUsername());
        elementBusiMplstp.setCreateTime(DateUtils.getNowDate());
        elementBusiMplstp.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplstp.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplstpMapper.insertElementBusiMplstp(elementBusiMplstp);
    }

    /**
     * 修改网元-业务-mplstp
     * 
     * @param elementBusiMplstp 网元-业务-mplstp
     * @return 结果
     */
    @Override
    public int updateElementBusiMplstp(ElementBusiMplstp elementBusiMplstp)
    {
        elementBusiMplstp.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplstp.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplstpMapper.updateElementBusiMplstp(elementBusiMplstp);
    }

    /**
     * 批量删除网元-业务-mplstp
     * 
     * @param ids 需要删除的网元-业务-mplstp主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplstpByIds(String[] ids)
    {
        return elementBusiMplstpMapper.deleteElementBusiMplstpByIds(ids);
    }

    /**
     * 删除网元-业务-mplstp信息
     * 
     * @param id 网元-业务-mplstp主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplstpById(String id)
    {
        return elementBusiMplstpMapper.deleteElementBusiMplstpById(id);
    }
}
